import org.rsbot.script.methods.Camera;
import org.rsbot.script.methods.Game;
import org.rsbot.script.methods.Mouse;
import org.rsbot.script.methods.Skills;
import org.rsbot.script.util.Timer;

final class VoluntaryThieve$Antibans
{
  private static final int MOUSE_MOVE_RANDOMLY = 0;
  private static final int CAMERA_MOVE_SLIGHTLY = 1;
  private static final int SKILLS_HOVER_THIEVING = 2;
  private static final int TABS_SELECT_RANDOM = 3;
  private static final int ALL_ANTIBANS = 4;
  private int currentAntiban;
  private final Timer timer = new Timer(0L);
  private int counter;

  private VoluntaryThieve$Antibans(VoluntaryThieve paramVoluntaryThieve)
  {
  }

  private boolean perform(int[] paramArrayOfInt, int paramInt)
    throws IllegalArgumentException
  {
    if (this.currentAntiban == 0) {
      if (paramArrayOfInt == null) throw new IllegalArgumentException("The selection of antibans is null.");
      if (paramInt < 1) throw new IllegalArgumentException("The probability is below one: " + paramInt);

      if ((paramArrayOfInt.length == 0) || (this.this$0.random(0, paramInt) != 0)) {
        return false;
      }
      this.currentAntiban = ((paramArrayOfInt.length == 1) && (paramArrayOfInt[0] == 4) ? this.this$0.random(0, 4) : paramArrayOfInt[this.this$0.random(0, paramArrayOfInt.length)]);

      if ((0 > this.currentAntiban) || (this.currentAntiban >= 4))
        throw new IllegalArgumentException("Invalid antiban in selection: " + this.currentAntiban);
      this.timer.setEndIn(this.counter = 0);
    }

    int i = VoluntaryThieve.access$9100(this.this$0).getSpeed();
    VoluntaryThieve.access$9200(this.this$0).setSpeed(this.this$0.random(4, 11));

    switch (this.currentAntiban) {
    case 0:
      if (this.timer.isRunning()) break;
      this.timer.setEndIn(this.this$0.random(755, 2345));

      if (++this.counter < this.this$0.random(2, 5))
        VoluntaryThieve.access$9500(this.this$0).move(this.this$0.random(5, VoluntaryThieve.access$9300(this.this$0).getWidth() - 253), this.this$0.random(5, VoluntaryThieve.access$9400(this.this$0).getHeight() - 169));
      else this.currentAntiban = 0;
      break;
    case 1:
      VoluntaryThieve.access$9700(this.this$0).setAngle(VoluntaryThieve.access$9600(this.this$0).getAngle() + this.this$0.random(-80, 80));
      this.currentAntiban = 0;
      break;
    case 2:
      if (this.timer.isRunning()) break;
      if (this.counter == 0) {
        VoluntaryThieve.access$9800(this.this$0).doHover(54);
        this.timer.setEndIn(this.this$0.random(1735, 2865));
        this.counter += 1; } else {
        this.currentAntiban = 0;
      }break;
    case 3:
      int[] arrayOfInt = { 1, 0, 11, 13, 5, 9, 10, 4, 7, 14, 15, 12, 6, 3, 2, 8 };

      VoluntaryThieve.access$9900(this.this$0).openTab(arrayOfInt[this.this$0.random(0, arrayOfInt.length)]);
      this.currentAntiban = 0;
      break;
    default:
      throw new AssertionError("Unsupported antiban in selection: " + this.currentAntiban);
    }

    VoluntaryThieve.access$10000(this.this$0).setSpeed(i);
    return this.currentAntiban != 0;
  }
}